import javax.imageio.stream.ImageInputStream;
import java.util.Scanner;

public class LeapYear {
    //用户输入年和月，输出这个月的天数

    /**
     * 判断闰年
     *
     * @return如是闰，返回true；否则返回false
     */
    public boolean isLeanYear(int year) {}
       if （year%400==0||(year%4==0&&year%100!=0){
            return true;
        }else{
            return false;
        }
    }

    /**
     *
     * @param year
     * @param month
     * @return
     */
    public int getDay(int year,int month){
        int day=0;
        switch (month){
            case 1:
            case 3:
            case 5:
            case 7:
            case 8:
            case 10:
            case 12:
                day=31;
                break;
            case 4:
            case 6:
            case 9:
            case 11:
                day=30;
                break;
            case 2:
                if(isLeanYear(year)){
                    day=29;
        }else{
                    day=28;
                }
        return day;
    }



}

    public static void main(String[] args) {
//接收用户输入的年和月
        Scanner sc=new Scanner(System.in);
        System.out.println("请您输入年份：");
        int year= sc.nextInt();
        System.out.println("请您输入月份：");
        int month= sc.nextInt();
        //opp编程第2步：创建对象
        LeapYear ly = new LeapYear();
        //opp编程第三步：对象调用方法
        int dayNumber=ly.getDay(year,month);
        System.out.println("本月天数："+dayNumber);
    }
    }